import request from '@/utils/request'

// submittedAssignmentsId studentId
export function getSubmittedAssignmentListAPI(submittedAssignmentsId, studentId, assignmentId) {
    return request({
        url: '/submittedAssignments',
        method: 'GET',
        params: {
            submittedAssignmentsId: submittedAssignmentsId,
            studentId: studentId,
            assignmentId: assignmentId
        }
    });
}

// 获取
// /submittedAssignments/getById
export function getSubmittedAssignmentsAPI(submittedAssignmentsId) {
    return request({
        url: '/submittedAssignments/getById',
        method: 'GET',
        params: {
            submittedAssignmentsId: submittedAssignmentsId
        }
    });
}
// 新增提交作业-学生
// /submittedAssignments
export function addSubmittedAssignmentsAPI(data) {
    return request({
        url: '/submittedAssignments',
        method: 'POST',
        data
    });
}

// 修改（评分）-教师
// /submittedAssignments/{submittedAssignmentsId}
export function editSubmittedAssignmentsAPI(submittedAssignmentsId, data) {
    return request({
        url: '/submittedAssignments/' + submittedAssignmentsId,
        method: 'PUT',
        data
    });
}

// 删除
export function deleteSubmittedAssignmentsAPI(submittedAssignmentsId, assignmentId, studentId) {
    return request({
        url: '/submittedAssignments',
        method: 'DELETE',
        params: {
            submittedAssignmentsId: submittedAssignmentsId,
            assignmentId: assignmentId,
            studentId: studentId
        }
    });
}